﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Model;
using BLL;

namespace EstateappraisalApi.Controllers
{
    /// <summary>
    /// 室内信息
    /// </summary>
    public class IndoorController : ApiController
    {
        IndoorBLL bll = new IndoorBLL();


        // GET api/indoor
        public IEnumerable<string> Get()
        {
            return new string[] { "value1", "value2" };
        }

        // GET api/indoor/5
        public string Get(int id)
        {
            return "value";
        }

        // POST api/indoor
        /// <summary>
        /// 添加室内状况
        /// </summary>
        /// <param name="value"></param>
        public int Post([FromBody]Indoor m)
        {
            m.indoor_CreateTime = DateTime.Now;
            m.indoor_CreatePeople = "1";
            if (bll.AddIndoor(m))
            {
                return 1;
            }
            else
            {
                return 0;
            }

        }

        // PUT api/indoor/5
        public void Put(int id, [FromBody]string value)
        {
        }

        // DELETE api/indoor/5
        public void Delete(int id)
        {
        }
    }
}
